/*
 * @Author: hcluo
 * @Date: 2020-05-07 14:48:04
 * @LastEditors: hcluo
 * @LastEditTime: 2020-06-19 17:15:38
 * @Description: 政府项目
 */
import React, { useRef } from 'react';
import ReactEchartsCore from 'echarts-for-react/lib/core';
import echarts from 'echarts/lib/echarts';
import windTheme from './wind.standard.theme.json';

import world from './world.json';

echarts.registerMap('world', world);
echarts.registerTheme('windTheme', windTheme);

/**
 * 中文文档： https://www.jianshu.com/p/f6c1c4618c22
 */

export default function WindChart(props) {
    let windChartInstance = useRef();
    props.getInstance && props.getInstance(windChartInstance);
    return <ReactEchartsCore ref={windChartInstance} echarts={echarts} {...props} />;
}

WindChart.propTypes = {};
WindChart.defaultProps = {
    style: {
        width: '100%',
        height: '100%',
    },
    opts: {
        // renderer: 'svg'
    },
    theme: 'windTheme',
    notMerge: true,
    lazyUpdate: true,
    showLoading: false,

    option: {},
};
